package com.nervenets.shopping.hibernate.domain.common;

import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Positive;
import java.io.Serializable;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class GlobalRuleSetting implements Serializable {
    @Builder.Default
    @ApiModelProperty(value = "订单自动取消时间（单位：分钟）", dataType = "int", reference = "订单", notes = "30", required = true)
    @Positive
    @Min(value = 5)
    private int orderAutoCancelMinutes = 30;
    @Builder.Default
    @ApiModelProperty(value = "订单发货后自动完成时间（单位：分钟）", dataType = "int", reference = "订单", notes = "7200", required = true)
    @Positive
    @Min(value = 30)
    private int orderAutoFinishMinutes = 7200;
    @Builder.Default
    @ApiModelProperty(value = "每人每天参团次数", dataType = "int", reference = "拼团", notes = "10", required = true)
    @Positive
    @Max(value = 10)
    @Min(value = 1)
    private int groupBuyTimes = 10;
    @Builder.Default
    @ApiModelProperty(value = "团长是否中签", dataType = "boolean", reference = "拼团", notes = "false", required = true)
    private boolean inviterBingo = false;
    @Builder.Default
    @ApiModelProperty(value = "优秀团长是否中签", dataType = "boolean", reference = "拼团", notes = "false", required = true)
    private boolean excellentInviterBingo = false;
    @Builder.Default
    @ApiModelProperty(value = "团长默认不中的邀请人数(团长开启中签后生效)", dataType = "int", reference = "拼团", notes = "1", required = true)
    @Positive
    @Min(value = 1)
    private int inviterNotBingoCount = 10;
    @Builder.Default
    @ApiModelProperty(value = "普通用户分享数量超过多少不中签", dataType = "int", reference = "拼团", notes = "3", required = true)
    @Positive
    @Min(value = 1)
    private int userNotBingoInviteCount = 3;
    @Builder.Default
    @ApiModelProperty(value = "团长分享数量低于多少中签", dataType = "int", reference = "拼团", notes = "3", required = true)
    @Positive
    @Min(value = 1)
    private int inviterBingoInviteCount = 3;
}
